---
sidebar_position: 1
slug: /
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

# Quick Start

Tango is a TypeScript re-implementation of [Android Debug Bridge](https://developer.android.com/studio/command-line/adb) (ADB) client. It works in both Node.js and Web browser by using different packages.

## Installation

Tango is split into multiple packages to handle different runtimes. You need to install at least two packages to use Tango

1. [`@yume-chan/adb`](https://www.npmjs.com/package/@yume-chan/adb): The core package
2. [`@yume-chan/stream-extra`](https://www.npmjs.com/package/@yume-chan/stream-extra): Polyfill for [Web Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) and utilities for streams
3. A transport object to communicate with devices

```sh npm2yarn
npm i @yume-chan/adb @yume-chan/stream-extra
```

## Direct Connection Transport

In this mode, Tango holds an exclusive, direct connection to the Android device. Google ADB is not required, nor compatible with this mode.

This mode is suitable for running on end-users' devices where Google ADB is not installed, or on mobile devices where Google ADB is not available.

`AdbDaemonTransport` class from `@yume-chan/adb` package provides this mode. Because the API for connecting to devices varies by platform and connection type, `AdbDaemonTransport` accepts a custom connection object.

<Tabs className="runtime-tabs" groupId="direct-connection">
    <TabItem value="usb" label="USB">

:::note[Next Step]

[Create USB connection](./daemon/usb/device-manager.md)

:::

    </TabItem>
    <TabItem value="tcp" label="TCP">

:::note[Next Step]

[Create TCP connection](./daemon/tcp/enable.mdx)

:::

    </TabItem>

<TabItem value="custom" label="Custom">

:::note[Next Step]

[Create custom connection](./daemon/custom-connection.mdx)

:::

</TabItem>
</Tabs>

## Google ADB Client Transport

In this mode, Tango talks to a Google ADB server, which can either run on the same machine or on a remote machine. Google ADB server manages the connection to devices, so multiple clients (including Tango) can share the same device.

`AdbServerClient` class from `@yume-chan/adb` package provides this mode. Similar to `AdbDaemonTransport`, `AdbServerClient` accepts a custom connector for connecting to the server on different environments.

:::note[Next Step]

[Connect to server](./server/connection.mdx)

:::

## Custom Transport

Tango also supports custom transports. For example, a mock transport can be used in tests, or a WebSocket transport to access devices on a server over the Internet.

:::note[Next Step]

[Create custom transport](./custom-transport.mdx)

:::
